package com.handler.base;

import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.LifecycleAware;
import com.event.ProcessorEvent;

/**
 * @author : gameZhao
 * @version V1.0
 * @Project: disruptorDemo
 * @Package handler
 * @Description: disruptor EventHandler实现类 这个是单列的，processorEvent通过参数传递,不同于 ThreadProcessorHandler
 * @date Date : 2021年12月27日 11:20
 */
public class DisruptorProcessorHandler extends BaseProcessorHandler implements EventHandler<ProcessorEvent>, LifecycleAware{
    
    public DisruptorProcessorHandler(String processorName) {
        this.processorName = processorName;
    }
    
    @Override
    public void onEvent(ProcessorEvent processorEvent, long sequence, boolean endOfBatch) throws Exception {
        execHandler(processorEvent);
    }
    
    
    @Override
    public void onStart() {
    
    }
    
    @Override
    public void onShutdown() {
    
    }
}
